Device-to-Device (D2D) communication is a new technology that allows, under control of a system, direct communication between terminals by reusing cell resources. It can increase spectrum efficiency of a cellular communication system, reduce transmit power of the terminals, and solve a shortage problem of spectrum resources of a wireless communication system to some extent. In D2D communication, discovery of a terminal is a basis for performing D2D communication.
In a conventional D2D terminal discovery method, each terminal registers its own unique identity with a network side in advance. When a first terminal needs to discover a second terminal, the first terminal sends a unique identity of the second terminal to a server; the server sends a service identity of the second terminal to the first terminal according to the unique identity of the second terminal, and triggers the second terminal to broadcast the service identity of the second terminal; the first terminal monitors broadcast information including the service identity, compares the service identity of the second terminal with the service identity in the received broadcast information, and if the two service identities are consistent, determines that a terminal corresponding to the broadcast information including the service identity is the second terminal.
In the conventional D2D terminal discovery method, the first terminal must learn the unique identity of the second terminal in advance. Therefore, the method can only be used to discover a known specific terminal and an application scope is relatively narrow.